package homeworks.cjt2010.homework1;

/**
 * Represents a model of <code>an passenger</code>.
 * <p>
 * This class has a share in {@link Flight Flight class}
 * 
 * @author Tsvetan Vasilev
 * 
 */
public class Passenger {
	// --- Instance Variables --------------------------------------------------
	private String name;
	private String ID;
	private long miles;

	// --- Constructors --------------------------------------------------------
	public Passenger(String name, String id, long miles) {
		this.name = name;
		this.ID = id;
		this.miles = miles;
	}

	// --- Getters and Setters -------------------------------------------------
	public String getName() {
		return name;
	}

	public String getID() {
		return ID;
	}

	public long getMiles() {
		return miles;
	}

	// --- Methods -------------------------------------------------------------
	
	// work version of toString()
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder(50);
		sb.append("Person: ").append(name);
		return sb.toString();
	}
	
//	@Override
//	public String toString() {
//		StringBuilder sb = new StringBuilder(50);
//		sb.append("Passеnger: name= ").append(name);
//		sb.append(", ID= ").append(ID);
//		sb.append(", miles= ").append(miles);
//		return sb.toString();
//	}
}
